package com.douyin.config;


import com.douyin.Interceptor.JwtInterceptor;
import com.douyin.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private IUserService userService;
    @Autowired
    private JwtInterceptor jwtInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(jwtInterceptor)
                .addPathPatterns("/admin/**","/authorize/**")
                .addPathPatterns("/douyin/**")
                .excludePathPatterns("/douyin/login/**","/douyin/index/**","/douyin/cdn/**", "/douyin/file/**");

    }


}
